package com.linpq.road.service;

import java.util.List;
import com.linpq.common.core.service.CrudService;
        import com.linpq.common.utils.DateUtils;
            import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.linpq.road.mapper.RdClimateEnvironmentMapper;
import com.linpq.road.domain.RdClimateEnvironment;
import com.linpq.common.core.text.Convert;
import com.linpq.common.core.service.BaseService;
/**
 * 气候环境Service业务层处理
 *
 * @author linpq
 * @date 2021-07-29
 */
@Service
public class RdClimateEnvironmentService  extends CrudService<RdClimateEnvironmentMapper, RdClimateEnvironment> {

    /**
     * 查询气候环境
     *
     * @param id 气候环境ID
     * @return 气候环境
     */

    public RdClimateEnvironment selectRdClimateEnvironmentById(String id) {
        return dao.get(id);
    }

    /**
     * 查询气候环境列表
     *
     * @param rdClimateEnvironment 气候环境
     * @return 气候环境
     */

    public List<RdClimateEnvironment> selectRdClimateEnvironmentList(RdClimateEnvironment rdClimateEnvironment) {
        return dao.findList(rdClimateEnvironment);
    }

    /**
     * 新增气候环境
     *
     * @param rdClimateEnvironment 气候环境
     * @return 结果
     */

    public int insertRdClimateEnvironment(RdClimateEnvironment rdClimateEnvironment) {
        rdClimateEnvironment.setCreateTime(DateUtils.getNowDate());
        return super.save(rdClimateEnvironment);
    }

    /**
     * 修改气候环境
     *
     * @param rdClimateEnvironment 气候环境
     * @return 结果
     */

    public int updateRdClimateEnvironment(RdClimateEnvironment rdClimateEnvironment) {
                rdClimateEnvironment.setUpdateTime(DateUtils.getNowDate());
        return super.save(rdClimateEnvironment);
    }

    /**
     * 删除气候环境对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */

    public int deleteRdClimateEnvironmentByIds(String ids) {
        return dao.deleteRdClimateEnvironmentByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除气候环境信息
     *
     * @param id 气候环境ID
     * @return 结果
     */

    public int deleteRdClimateEnvironmentById(String id) {
        return dao.delete(id);
    }
}
